<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Repair extends Model
{
    use HasFactory;

    public $table = 'repair';

    public $guarded = [];

    public $casts = [
      'created_at' => 'date:Y-m-d H:i:s',
      'images' => 'json'
    ];

    public function tenant()
    {
        return $this->belongsTo(Tenant::class);
    }

    public function house()
    {
        return $this->belongsTo(House::class);
    }

    public function contract()
    {
        return $this->belongsTo(Contract::class);
    }

    public function business()
    {
        return $this->belongsTo(Business::class);
    }
}
